package com.eureka;

import com.google.common.collect.ImmutableMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 提供给服务调用者eureka-service-invoker调用
 * Created by earl on 2018/4/17.
 */
@RequestMapping("/provider")
@RestController
public class ProviderController {

    @GetMapping("/person/{id}")
    public Map person(@PathVariable String id, String name, HttpServletRequest request){
        return ImmutableMap.of("id",id,"name",name ,"url",request.getRequestURL().toString() );
    }


}
